import request from '../utils/request';
import host, { filter } from '../utils/constant';

export async function list(params) {
  const { baiJiaPageNum, baiJiaPageSize, name, category} = params;
  const requestUrl = `${host}/baijia/list?pageSize=${baiJiaPageSize}&pageNum=${baiJiaPageNum}&name=${filter(name)}&category=${filter(category)}`;
  return request(requestUrl);
}

export async function total() {
  const requestUrl = `${host}/baijia/total`;
  return request(requestUrl);
}
